<?php 
    $url = new Url();    
?> 
<div id="content" class="clearfix">        

    <div id="homeContentRight" class="contentWrap ut-TEACHER">

        <?php $this->widget("LeftBar");?> 

        <div id="content_middle">
            <div class="feedTitleWrap clearfix">
                <h1 id="feedTitle"><p class="eIcon">Nhóm <?php echo $data_group['group_name'] ?></p></h1>                                         
            </div>
            <div class="postBoxFeedWrap">
                <div id="postBoxWrap" class="clearfix">
                    <p class="pbLabel">Gửi:</p>
                    <div class="PostBox">
                        <div class="post-types">
                            <a class="note active">Ghi chú</a>
                            <a class="assignment" href="<?php echo $url->createUrl("group/assignment",array("group_id"=>$_GET["group_id"])); ?>">Bài tập</a>
                            <a class="alert">Báo động</a>                            
                            <a class="quiz">Câu hỏi</a>
                            <a class="poll">Bình chọn</a>
                        </div>
                        <div class="entry-boxes">
                            <div class="post_box TextPostBox" style="display: block; ">
                                <textarea id="stt_content" tabindex="42" style="overflow: hidden; " rows="" cols="" onfocus="show_receiver()"></textarea>
                                <div class="err" style="display: none;" id="stt_content_error">Tin nhắn của bạn không được để trống!</div>
                            </div>
                        </div>
                        <div style="display: none;" id="receiver_box">
                            <div class="ReceiversBox to-div" style="display: block;">
                                <div class="receivers" style="width: 437px;">
                                    <input id="receiver_name" type="text" class="input-field" style="width: 100%;" value="Nhóm <?php echo $data_group['group_name'] ?>" disabled="disabled">                                    
                                </div>                            
                            </div>
                            <input type="button" class="send" value="Gửi" style="display: block;margin-top: 0px;" onclick="send_stt(<?php echo $_SESSION["user_edu_net"]['user_id']; ?>,<?php echo $data_group["group_id"]; ?>)">             
                            <div class="err" style="display: none;margin-top: 5px;" id="receiver_name_error">Chọn người nhận cho tin nhắn của bạn</div>
                        </div>
                    </div>
                </div>
                <div id="message-feed">                    
                    <ul id="feed" class="feed-container">    
                        <?php foreach($post_data as $row_post){ ?>    
                            <li id="fmsg-74673511" class="post-entry delete_rights">
                                <a class="avatar" href="javascript:">
                                    <img class="small_avatar" src="<?php echo Yii::app()->params['urlRs'];?>/images/9_0_t.png" alt="iColdStyle">
                                </a>
                                <div class="textpost">
                                    <div class="msg-info">
                                        <span class="msg-receiver sender-name"><?php echo $row_post['sender_name'] ?></span> gửi tới <a class="msg-receiver" style="color:#336699" href="javascript:"><?php echo $data_group['group_name'] ?></a>        
                                    </div>
                                    <div class="msg-content-container">
                                        <div id="msg-content-text-74673511" class="msg-content-text ">
                                            <?php echo $row_post['pGroup_content']; ?>
                                        </div>
                                    </div>  
                                </div>
                                <ul class="post-entry-footer">
                                    <li class="time-ago"><?php echo date('j',$row_post['pGroup_create_date']); ?> tháng <?php echo date('m',$row_post['pGroup_create_date']); ?>, <?php echo date('Y',$row_post['pGroup_create_date']); ?></li>
                                    <li class="msg-reply"><?php echo date('H:i',$row_post['pGroup_create_date']); ?></li>
                                </ul>
                                <div class="clear-div"></div>
                                <ul id="comments-74673511" class="comments">
                                    <?php foreach($post_reply as $row_reply){ if($row_reply['rGroup_post_id'] == $row_post['pGroup_id']){  ?>    
                                            <li id="comment-content-80642185" class="comment-content">
                                                <a class="comment-avatar" href="javascript:"><img class="small_avatar" src="<?php echo Yii::app()->params['urlRs'];?>/images/default_avatar_t.png"></a>
                                                <div class="comment-right ">
                                                    <span class="comment-wrapper comment-wrapper-full"> 
                                                        <a class="sender-lnk" href="javascript:"><?php echo $row_reply['sender_name']; ?></a> -
                                                        <span class="commentTxt"><?php echo $row_reply['rGroup_content']; ?></span>
                                                    </span>
                                                    <ul class="extra-info">
                                                        <li class="time-ago"><?php echo date('j',$row_reply['rGroup_create_date']); ?> tháng <?php echo date('m',$row_reply['rGroup_create_date']); ?>, <?php echo date('Y',$row_reply['rGroup_create_date']); ?></li> 
                                                        <li class="msg-reply"><?php echo date('H:i',$row_post['rGroup_create_date']); ?></li>
                                                    </ul>
                                                </div>
                                            </li>
                                            <?php } } ?>
                                </ul>
                                <div class="reply-container comment-reply" >
                                    <img class="avatar small_avatar" src="<?php echo Yii::app()->params['urlRs'];?>/images/default_avatar_t.png">
                                    <textarea class="message-comment-area" id="content_reply_<?php echo $row_post['pGroup_id']; ?>" style="overflow: hidden; " onfocus="show_btn_reply(<?php echo $row_post['pGroup_id']; ?>)">Trả lời...</textarea>                                    
                                    <p class="empty-reply-error" id="error_reply_<?php echo $row_post['pGroup_id']; ?>" style="display: none;">Trả lời của bạn không được để trống!</p>
                                    <div id="btn_reply_<?php echo $row_post['pGroup_id']; ?>" style="display: none;">                                        
                                        <input type="button" class="reply-btn blue-btn" value="Trả lời" onclick="send_reply(<?php echo $row_post['pGroup_id']; ?>,<?php echo $_SESSION["user_edu_net"]['user_id']; ?>,<?php echo $data_group["group_id"]; ?>)">
                                        <input type="button" class="cancel-btn grey-btn mt0" value="Hủy bỏ">                                    
                                    </div>
                                </div>
                            </li>
                            <?php } ?>                
                    </ul>
                </div>
            </div>
        </div>

        <?php $this->widget("RightBar");?> 

    </div> 

</div>

<?php include "index.js.php"; ?>
